Include the type info in the xpfields field array, also some new ways to attach events