i-bem: 30% speed improvement by better escaping

* faster escaping of xml/attributes
* less time in creating context
* avoid hidden class creation by using $$registerExtensions
* use Array.isArray where possible