database: changed to OOP

use __call as exported
functions: switched container name to "functions"
handlers: added maploader