Made package queries faster and added value constraints.
Efficiency improvements and memory leak fixes.

  - Packages are read on-the-fly, using mmap() instead of malloc() and read().
  - Packages are read only once. Originally, they were freed after their verification to reduce memory usage. However, the use of mmap() means they no longer waste much precious memory.
  - The parsing of the package format is done only once.