Refactored HTML5 class (no more static methods) and explicit error
handling