Extensions from ICFP contest

Not to merge yet. This is the code from the ICFP contest, which I managed to transplant into this repo with significant Git hackery (git bundle, git replace, git filter-branch twice...).