update input reader to accept both Unix and Mac line endings (as well as Windows)