Added gitignore.
Refactor to make more Java-esque.

*Removed out parameters.
*Refactored most static methods to class methods.
*Removed operations that are mathematically not well defined.
*Updated tests.
Merge pull request #1 from JSkelly/refactor

Refactor to make more Java-esque