Added model.

The model class was declared in the initial commit but in this commit, all methods are implemented and the class acts as a bridge to the local database.