Fixed python plugin to work with new layer factory.

@Yangqing This addresses your first question.