Created Functions for individual operations

Created functions for all the individual operations and main, added querying groups, added clearing all incoming messages, added formatting, changed options into separate groups, added headers for the query, added a query after clearing incoming and outgoing to show they have been cleared.