Merge pull request #196 from rrthomas/master

Factor out master name validation