Improve core to be more pythonic

Use generator and get rid of mutual recursion
Add HTML doctypes
Refactor html5 function

to insert doctype and implement logger
Fix licence
Merge pull request #4 from nbessi/add_doc_type

Refactor of core:



    Get rid of mutual recursion
    Use generator
    Implements doctype
    Fix licence