Added some database stuff.
Added the basis of a validation thingy.