support for plugin layers for QGIS API 2 (by Peter Wells)