Cleanup opengl realated functions

- Change documentation comment style
- Formatting
- Tune the code to allow dart2js to generate better output
- Change type annotations from num to double (and the toDouble calls) to match the style of the other parts of the library
- Don't use the * operator on matrix as it requires type checking, directly call the right method