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.
Merge branch 'next2' into gd