Let there be TRANSACTIONS! This is not well tested, but first indications show it is working. Does not handle server failure or transaction timeouts. Unsure if the log in/log out semantics are correct with caching login.