Html parser

Moving HTML parser code refactoring into the master branch.