Modify extension handling to allow for .coffee.md

This addresses #2736.

Source file name processing is moved to `helpers.coffee` and standardized. The new function also accounts for the fact that `path.extname` only returns the last file extension - returning only `.md`, rather than the full `.coffee.md`.