More better refactorings and stuff

Several commits in this PR.  Better specs, more coverage, etc.  Followed Martin S advice.