Major refactor of lots of code, better level support.