Swap out iterative loops with functional equivelents.

Per our discussion earlier here is a refactored version of the getters and setters using underscore functions instead of iterative loops. I also went ahead and cleaned up some of code and fixed the test coverage to cover the paths that were changed.