add support for more file extensions and constants w.r.t. sources

this builds on PR #738 by @fgeorgatos, and fixes style fixes and enhances the relevant unit test