Fixes #661 - HTML5 validation

Things don't validate 100% but this takes care of some low-hanging fruits.

See #661.