Choose syntax from file extension, not content.

Closes #8. Extension of @imathis's PR.