Added initial database cleanup, and also delete chat history functionality.
Also included the updated unit testing for the new functionality.