Separating trac database into the defined type trac::db
Adding some spec tests