[python-bindings] Added OpCode like support for all enumerations with unittests.

Also fixed some trailing whitespace issues.