Initial commit

Somewhat simpler than last time. Potentially resolves #1.