Move functions operating on package bases to a separate file. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>