This means there's no further confusion around screens being deactivated
without first being activated. This is also closer to the Caliburn.Micro
model.
The Initial state used to be useful for determining the first transition
to Activated, but that turned out not to work, see recent commits.
This caused a regression when screen states were added. Childre of
conductors are deactivated initially, then activated when the parent is
activated. This caused the Initial -> Deactivated transition. Then when
the child was activated, the 'from' state was not Initial, and so the
OnInitialActivate method was not called.
The choice to remain in Initial in this case makes sense: we don't want
to go to Deactivated (and come up with another mechanism for firing
OnInitialActivate), as that would fire OnDeactivate without there being
a corresponding OnActivate, which might mess things up.
In some paths to some methods, we just know the RuntimeTypeHandle. In some,
we know both the Type and RuntimeTypeHandle. Optimize such that the Type
is used if available, otherwise Type.GetTypeFromHandle is used.
This should mean that StyletIoC is just as quick as it was before this
refactor.
Types are reasonably expansive, and when you've got a lot of them, the
memory usage adds up. We don't actually need the Type most of the time -
the hot path just does a dictionary lookup, and we only need the
RuntimeTypeHandle for that.
Besides, Type.GetTypeFromHandle is cheap - typeof(T) does it internally.
So, just use RuntimeTypeHandle on the hot path, and swallow the cost
of an extra Type.GetTypeFromHandle in the rare case that we need an
actual Type.
Instead of creating tons of registrations for all discovered types,
instead create those registrations as and when they are requested.
This means we don't flood the CLR's type cache with RuntimeTypes which
are never used but can never be collected.