Redmine 2.x compatibility

This pull request contains fixes that allow the plugin to work on Redmine 2.x. I have *not* tested compatibility with Redmine 1.x, so things might break. Even so, this might be of great use for Redmine 2.x users.

This tweak can either be tested with Redmine 1.x to allow for cross-compatibility or offered as a separate plugin.

Looking forward to your feedback!