Add HTML5 mode, secure potential recursive loops, document new functionality