Massive cleanup.

This resolves issue #10