Clean up code

Cleaned up minor synthax and white spaces.

Also changed the state storage in NPTurtle from dictionaries
to a custom NPTurtleState class.