In the CLI `UpdateRecorder` methods such as `insertLeft`, `remove` etc.. accepts positions which are not offset by a BOM. This is because when a file has a BOM a different recorder will be used https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/src/tree/recorder.ts#L72 which caters for an addition offset/delta.
The main reason for this is that when a developer is writing a schematic they shouldn't need to compute the offset based if a file has a BOM or not and is handled out of the box.
Example
```ts
recorder.insertLeft(5, 'true');
```
However this is unfortunate in the case if a ts SourceFile is used and one uses `getWidth` and `getStart` method they will already be offset by 1, which at the end it results in a double offset and hence the problem.
Fixes#14551
Replacment of line endings should only happen to increase the hash matches as otherwise the recorder will fail to update the correct positions
Fixes#14443
If a polyfills file is original, then replace completely with latest version of the file. This removes the need to deeply analyze the file as well as ensuring all comments are up to date. Also skips analysis if there is no mention of `core-js` of any form in the file.
The header re-addition check is also reduced in scope to account for varying versions of the header content.
We don't know yet if we are going to separate zone.js in a separate file. Hence, we should remove this for the time being and include it only when we remove zone.js from the main polyfills files
1. Remove imports of es6 polyfills introduced by the CLI.
2. Refactor the migrations for version 8 by moving the codelyzer and
polyfill transforms into different files.
The PR drops all `core-js/es6` polyfills that we've introduced with the
CLI, except the commented ones. We do not remove commented imports,
since they are not part of the internal es6 polyfills.
The migration automatically drops the
associated comments with the removed imports since they are part of the node - under its
`jsDoc` property.