refactor everything up intil app stuff. need to test

refactor query

blargh

there's no model!

move root files to a lib

err