Plugin simplification

Make plugin definition easier using preprocessor macros, and modify viewer examples so that a painter can be specified as a commandline parameter