more work with db and login

added a ton of stuff to support binding values and accessing the results
on prepared statements and lots of debug messaging and more of the login
logic