Merge pull request #6 from sviperll/master

Some bug fixes and some slightly questinable changes.
Minor cleansing after merge; fixed one potential
ConcurrentModificationException
Clean and simplify import generation process.