Add catch-all is_valid_modref method

This ensures that expressions like `parse("@1")` throw the right error.

Also, I added a closing quote to the error message.