initial pass at #163
some cleanup
also part of #163
also part of #163
fix a makefile typo
Merge remote-tracking branch 'origin/master'