HTML5 support and some markdown extensions

Only minor improvements, fully backwards compatible.