Changed command-line interface to not assume the database instance.
Changed implementation to use 10 threads for performance reasons.