Adding basic tests for PulsesManagerPlugin, and fixing the bugs dicovered by the tests.