Updating the code for generating dynamic plugins.

Includes various cleanup and layout changes, support for "make
install", and support for Darwin.