Added repository processing for agent

Implemented mongo procedures for saving repo data as well as REST
service.