The handling of comment lines is only performed before macro
expansion, thus lines with macros that expand to comment lines will
not be correctly handled as comment lines.
By chance this kind of worked sometimes because a "#" command that
does nothing is internally added to the command registry to make it
show up in the help output. Relying on this is broken. Furthermore,
if the line starts with '#' followed by a non-separator character
(e.g. "##", "#whatever", etc.) it will not work (i.e. it will produce
a command-not-found error).
This fix checks to see if the first character of the line after macro
expansion is '#'. If it is, it considers the line to be a comment.