Add callbacks

I've changed the emitters to callbacks so as to allow for more flexible handling of SQL query results.  I've also updated the tests and they're passing TravisCI so they should be good but you might want to give them a double check?