Upgrade markdown 2.4.1

- Upgrade markdown version to 2.4.1 with SmartyPants (smarty) extension (plus general improvements)
- Take ST abstraction out of the markdown library and place in markdown_wrapper.py
- General fixes such as:
    - undefined references
    - don't call `unicode` in Python 3 (it doesn't exist: str are unicode and bytes are non unicode byte arrays)
    - fix general lint warnings