Massive refactor to make presentable to others.
Debugging, added TODOs.