Circular function expressions

Fixes #445 and #583.

Function expression bodies are now checked in a separate phase after all statements in the enclosing body to ensure constructs like the following are correctly typed:
```typescript
var foo = function () {
    var s = foo();
    return "hello";
}
```
Previously we'd perform a full type check of the body of the function expression whilst in the process determining the type of `foo` which would cause `foo` to be given type `any` because of the recursive reference. With this change, `foo` is now correctly typed as `() => string`.
Previously this error wouldn't be reported because the expression in the return statement isn't type checked if the return statement occurs in a disallowed location. It's not worth the complexity to recompute whether we should skip the function expression body check phase, so the check always occurs.