Functional & Style changes to generated code.

These changes are to match Ruby style and to fix order of
operations on expressions and referencing class variables and constants.

- Removed '_' from all attributes.
- Wrapped complex expressions in parens when proceded with a not keyword
- Used explict name of the parser class when referencing internal classes
  and some constants
- switched to 'if  x then' from 'if not x.nil? then'. It reads better in Ruby.
primary test driver for runtime
StringIO.new -> StringIO.open

The docs said open and new were equivilant with an exception I overlooked.