cleanup, add tests, move untested stuff out of include dir