Refactor to not read whole file into memory, and to not use regex. (Five-fold speed increase.)