refactored to package layout
various fixes due to refactor
fixed purge database task and added a couple of features to SubscribedTask