allow leading and trailing spaces before a header when parsing out mini-toc. some general clean up. for WEB-6325 +review WEBCR
Merge pull request #32 from splunk/dev-WEB-6325

allow leading and trailing spaces before a header when parsing out mini-toc