Recoded some of langcluster in a more modular form.

Fixed a couple of typos.