Fixed python plugin to work with new layer factory.

Shouldn't include cpp. The problem should be fixed in #1208 when that is pulled.