Strengthen transactions

Hello, i rewrote thing related to:
 transaction management (ie commit, rollback)
 cleaning up (destructor)
 fields visibility (public, private)
 choosing charset while connecting (default is utf8)
 adding the permanent stuff in an optional constructor argument.