Added namespaces. Did a lot of work on the query building as I tested it during site development. Worked on exceptions and error handling. Fixed several bugs.

**Still not production ready!