Merge pull request #7 from JesseWeinstein/various-cleanup

Various cleanup, factoring out duplicate code
Various minor changes & fixes.