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