Added database generation script.
Updated queries to simplify database interactions.
Removed junk that is no longer needed.