Completed implementation of Xtension module.
Some code clean up.