Refactor to make more Java-esque

Changes
======
* Added gitignore file.
* Removed out parameters.
* Refactored most static methods to class methods.
* Removed operations that are mathematically not well defined.
* Updated tests.

Notes
====
Thoughts I'd send a pull request your way. Feel free to comment and incorporate if you like.