Add check for empty working directory (fixes #186)

This adds an automatic check for empty working directory.
It also mitigates one of the issue when upgrading from IDEA 12 + 0.9.13 to IDEA 13 + 0.9.15.