I was playing around with the idea of a double key keyboard.
In the back, it builds a huffman tree using probabilities I entered from Wiki for english letter frequencies. The algorithm is surprisingly simple, and implementable using JS.
Check it out here.
http://jsdo.it/arithma/xPJI