Did some refactoring so that exceptions are now used, and reply IDs are now stored in the database