Removing some dead code and refactoring

Using values was becoming more and more
painful, so I'm moving everything over to
use pointers instead. This should simplify
a number of things.