Add database abstraction functions.

Add
 - add/remove media item functions for inventory
 - update/updateRating functions for media items in inventory
 - worked on building a search/query builder for items in inventory