Drastic re-organization and improvement.

Closes #1.
Closes #2.