changes related to #679

- remove use of mutable string operations: chop!, lstrip! and rstrip!
- calculate time elapsed using floats
- use $~ instead of numbered variables in regexp substitutions
- match endline in line break regexp
Merge pull request #726 from mojavelinux/issue-679-partial

changes related to #679