Begun adding tests, fixed carriage return handling