Fixed python plugin to work with new layer factory.

Dumping all build commands from cmake and visually inspecting them should give us a clue. Having limited bandwidth on this but will look into it when I have more time.