Core code for getting matadata for packages and files