Rearranged file structure. Added nice close.

Rearranged file structure for more correct packaging. Politely
disconnects from database on close.