Performance improvements to implementation.

- Replace boxed numeric types with unboxed primitive types.
- Simplify some of the generic types.
Merge pull request #2 from mspiegel/initial-performance

Initial performance improvements