Fixed recompilation of up-to-date files.

I moved code from @shian's pull request #9 to separate function and used for handling files which are affected by .hrl updates. Looks like this prevents all recompilation on system start and everything else works as before.