Major refactoring of all base classes

Generalised updating objects into DB.
Added data.service to manage all base classes.