Conditionally emit rest parameters

This is a sketch to omit code emission for the `...rest` parameter when it's not used in the body.

With this patch, the example in #498 will be compiled without generating code for the `...rest` parameter.

If this is the right approach, I can complete the implementation by handling the other cases in the new `isParameterReferencedInBody` method.

Hi @duncanmak! After re-reading your original pull request message, I realized that you may be looking for some guidance in making this contribution. Let me me just say thank you for your interest and efforts so far.

I think what you're *trying* to do is to appropriately traverse the body of a function in a smart way to short-circuit on a `return` statement if you haven't seen the parameter yet.

Firstly, you will need to recursively traverse the body - in other words, within the function, you will have to also traverse the bodies of `for`/`while` loops (as well as the expressions which they test!), `if`-`else` constructs (again, be sure to check the condition expressions they test), etc. separately.

We actually have a function that makes this pretty darn easy - `forEachChild` ([found in parser.ts](https://github.com/Microsoft/TypeScript/blob/b73558d2082aada714b56a310b273e8147d35732/src/compiler/parser.ts#L172)). A pretty clear (well I guess that's subjective, since I was the one who wrote it...) example where this is used is the `forEachReturnStatement` function [which can be found here](https://github.com/Microsoft/TypeScript/blob/b73558d2082aada714b56a310b273e8147d35732/src/compiler/checker.ts#L4394). The name is kind of misleading, since the function actually short-circuits if you return a ["truthy" value](http://dorey.github.io/JavaScript-Equality-Table/#if-statement).

Secondly, I would avoid trying to be too smart here - JavaScript has a *funny* tendency to surprise you when you try to do that sort of thing! For instance, if I'm right that you're trying to bail out if you hit a `return` statement early, that can lead to some issues:

```TypeScript
function f(a: string, b: number, ...rest: any[]) {
}
```