Make it build

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Edits and code fixups.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Merge branch 'master' of github.com:ezyang/tmr-issue22