Make EntityRegister be capable of handling initialization order.

Now the extension writers do not need to worry about EntityRegister's
execution order.
Make some comments Doxygen-formatted in Entity.h.