Fixed python plugin to work with new layer factory.

@Yangqing I agree that the right solution is to align the CMake build with the Makefile. Locally adding a source file to a target cannot be right. I don't know why the CMake build is so different in the first place.