tweaks to ATX header patterns

only match at start-of-line
only match if markers followed by '.' or ')'
don't match at end-of-line unless there's at least one '#'
add option to require blank line before ATX header