simpler while loop, add source_lines method to Document
Merge pull request #177 from mojavelinux/minor-cleanups

simpler while loop, add source_lines method to Document