Session & Security use prepared-statements.

We hit these queries a lot, so using prepared statements and always hitting the primary key to speed things up.
It would be better to have the prepare statement as a new function in the protocol. Leaking alia out of the db layer doesn't make sense. 'Prepare' is generic enough.