Unify the -/= and ## style headers

so that TOC can be generated properly from a mixed-markup document.

With the current code the TOC for the following document:

````
hb
---
````

is generated as: hb ha hc, while the correct order would be ha hb hc
Merge remote-tracking branch 'upstream/master' into unify_header_handling
Retain existing unittest to avoid reducing coverage
Merge pull request #133 from udacity/unify_header_handling

Unify the -/= and ## style headers