Moved database access methods to DatabaseHelper and implemented JOIN for
querying events by severity.