added support for extensions using extensions.

complete rewrite of extension definition processor in Xtend.