Changed database handler

Added: the handler is now supporting the library connection packets
Added: retrieve document function now uses a prepared statement
Fixed conflict