Class for dealing with database - beginning.