Integrate AnalysisResult directly into the Phase classes.

All phases return some result. This is useful for unit testing and dumping a result.
There is a subtrait AnalysisPhase which additionally has a success value This is for
lexical, syntactic and semantic analysis. The rest of the phases should not be able
to fail.