Cherry & Foster (2012)'s kbmira implementation, ripped from Moses, self-compiling