Bugs/issue 9

Removes some hard coded SQL strings in favor of AR query building to promote cross-db adapter support (mainly MySQL and Postgres).

Completes #9