Initial version for code review

Because the initial development was occurring on master, there isn't an easy way to do code review. This pull exists solely as a means to code review the entire project. Any changes will be put straight into master and this pull will be closed and the `initial-code-review` branch deleted. All future development will use pull requests into master to facilitate code review.
> scoped -> scope?

Fixed with 6ecfc9d8eb5884d4514b3cf838a154a01c9adfbb.

> Also we check that all the scopes are of type Scope in the constructor, but not here.

The language checks this for us because of type hinting (`Scope $scoped`).

> I think if we're going to do it there we should do it here too

It actually went the other way around - I added the type hinting to this function so you can only add `Scope`s so I had to make the constructor do the same check. Although `array<Scope>` would be nice, you can't get any more specific than `array` hence the the loop and `instanceof` check.