Added basic debugging functionality
I think a lot has been done, but some things does not work.
Begun rewrite to remove OO
Tests passed. OO removed!