added getter for realm

An extending class might want to override 'beforeMethod'. There it needs to have read access to the 'realm'.
cleanup
added test for basic plugin
Merge pull request #329 from elHornair/patch-1

added getter for realm