Rewritten from scratch to pure HTML5; added MIT license.