Added a hash onto buildDb and refactored exists package to also return the packageId