Imported from https://code.google.com/p/vaadin-activelink/
Now compatible w/ 7.3 thanks to Sami Viitanens patch
Also some cleanups.