incorporate Eli's cleanups; explicitly use Fixnum + unsafe ops

This pull request:
* incorporates @elibarzilay's cleanups in #21, resolving conflicts.
* explicitly uses unsafe Fixnum operations (slight speedup by ~0.3s on my computer)