Use more functional style in building filter chain

Thanks @dchelimsky
Match location to first line of a doc string.

Introduced an `attributes` concept for an AST node, things that have
a location but aren't part of the source for node.

@mattwynne I think we will need a new range location.