filecount and contextswitch plugin support

I've added support for the filecount plugin and for the contextswitch plugin

There's a previous version of the support in the history - was thrown away in favour of the simpler final solution.
There's also one random bugfix the the DNS support which called an undefined function.