a lot of changes, sorry for the unhelpful commit log

will be better when i get it more finished and stable
a few more changes