Merge pull request #47 from sanity/regRefactorTake2-ian

Reg refactor take2 ian
Merge pull request #54 from sanity/master

Merge pull request #47 from sanity/regRefactorTake2-ian