Further updates to database access

Modified activity access and the activity class to manage creation
of activities based on objects. Also modified the Activity class
to match the changes made to DB access classes. Fixed some minor
formatting and commenting issues as well.