Fixes for API changes to make it work in Intellij IDEA 12.

Only small changes to reflect Intellij IDEA API changes. Plugin now works in Intellij IDEA 12.