Fixed bugs.
Added mysql auto reconnect flag.
Fixed some bugs. Also disabled persistent DB connections.
Cleaned up commented stuff.