Added support for automatically extracting file dependencies, few bug fixes