Support more configurability in GN toolchains

This uses substitution patterns in toolchains to allow the toolchain to specify more flexibly how files are to be named and generated at each step. The toolchain now has control over the naming of object and executable files, for example, where before these were hardcoded.

This removes most of the OS-specific logic hardcoded into the GN tool. There is still a bunch in action invocation; this will be done in a followup.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/440333002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/gn@290685 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Add GN substitution support for Ninja's $in_newline

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/493493004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/gn@290700 4ff67af0-8c30-449e-8e8b-ad334ec8d88c