More implementation

Started on the eval function in Database. Added some helper functions
for evalQuery() so it doesn't get super messy.