Allow name-a in graph

Task names containing the string `-a` were failing because of an old
assumption. This fixes the problem, and adds tests.
Merge pull request #1246 from matthewrmshin/task-a

Allow name-a in graph