Dev install fixes

This fixes a number of bugs in the installer and is an extension to #410. 

Main issues were:
* Invalid SQL file preventing installation of dummy post & pages
* Migrations used the Query objects in string context
* insert_get_id() wanted to use the PDO object which wasn't available for public use.

I'm not sure if my work arounds are the right way to do it, but it's a way that fixed a few things.

Unfortunately I haven't quite been able to figure out #412 though :frowning: