Add support for managing the `performance_schema`

This is #226 rebased on top of the latest master, with a bug fix and some test coverage.