style fixes, removed bunch of commented code

slightly changed the handling of NodeEncoder class to make commented out code more useful