Add class method to check for valid reference names.
Remove whitespace.
Add tests.
Merge pull request #213 from 5sw/reference_is_valid

Add class method to check for valid reference names.