Introduce singleton components

A singleton component is a component that can only be assigned to one entity
per system. If the component is assigned to another one, the old entity
automatically loses the component.

The handling of these singletons is faster than for normal components as
the implementation can take advantage of the singleton nature of the component,
at minimal cost of type checks here and there.

Clean up some code.