Major refactoring.

* Switched from JS to CS.
* Switched to our proxy server (to communicate with Embed.ly).
* Other mostly minor improvements.