moved stats into this package, updated test to use new style of code, made a bunch of edits so the whole thing builds (still untested)