Add module tracking

This is very early, incomplete and unpolished version that works only on simple files.
Merge pull request #39 from vosen/master

Add module tracking