Enhanced open

This PR changes the `open` method to use `io.open` (note that in Python 3 the latter is just an alias for the `open` built-in function). All methods that used the `open` built-in function directly have been changed to use `Path.open` instead, so that a subclass only has to override one method to implement a customized open.

In addition, newline patterns have been moved to module-level variables, and regular expression matching is used for removal and replacement. This makes related code more efficient, compact and easier to maintain.
Because the signatures are different in Python 2 and Python 3. Specifically, the py3 version adds the `opener` arg. In this way, the user knows exactly what's supported and what not.