Cleaned up DBQuery and DBStore

Improved style, commenting, and some small error handling in
DBQuery.java and DBStore.java.