More SQL

Got it working nice and fast for inserts.
Still lots of modularization to do.
And tests.