moved a few things around, seems like a logical place to commit
todo

fix that sql stuff and test to make sure that the moved libraries has not caused some sort of unexpected error, look into that problem with the db transaction and the incramenting selection thing
Merge branch 'dev'