Completely rewrote db abstraction portion (Query replaced with Db). Paved the way for multi-database support.