Initial working port of original prototype code.

Squashed commit of the following:

commit c7004e4074cd18441ee89f1c55941a232b0d8079
Author: Jeremy Kahn <jeremyckahn@gmail.com>
Date:   Sun Dec 8 20:43:31 2013 -0600

    Tags 0.0.1 release.

commit 81f2478e1c54ba9f3198937b4bb3fdddd4c2affd
Author: Jeremy Kahn <jeremyckahn@gmail.com>
Date:   Sun Dec 8 20:42:44 2013 -0600

    Fixes some broken references.

commit 58f15ff9929d71db0adfc648b8fc599706518c72
Author: Jeremy Kahn <jeremyckahn@gmail.com>
Date:   Sun Dec 8 16:49:24 2013 -0600

    Initial port from original prototype code.  WARNING: Untested.