merlin: update from 1.7.1 to 2.0

Also adds an option to compile the emacs mode at install time.
Merge pull request #4810 from vbgl/merlin

merlin: update from 1.7.1 to 2.0