made a dbgprint and changed statedata stuff

dbgprint prints the stuff if NDEBUG is not defined, the same way assert
works
statedata uses std::array instead of new[]ed up known sizes