reorganization and commit of Licata's agda code from OPLSS 2013 lectures