Added own extend for definitons, changed managment of database definitions

Own implmentation of function for extending objects (especially db definition
objects) was added. Changed managing of database definitions to better way.
Added server side tests.