Change em/ema loading to instance methods and use current instance as scope

This allows a scope to attach functions before executing the em/ema scripts in case those scripts reference those functions