Implemented Database Functionality

Implemented the functionality for talking to the sql database. This
includes inserting and retrieving questions. Retrieving Category + ID.
Added interfaces for such. Also refactored some code and the database to
lessen code duplication and make it more logical.