Cleanup Ray

- More documentation
- Formatting
- Remove copyOriginDirection (who needs such a method?)
- Tune the code to allow dart2js to generate better output (in a later PR)