Session and security with prepared statements.

And always getting things by primary key.
Merge pull request #120 from MastodonC/feature/better-user-lookup

Session & Security use prepared-statements.