Change usage of `self = this` to use arrow functions instead. Also fixes a reference error where `self` wasn't defined.
Merge pull request #27 from Benvie/master

Change usage of `self = this` to use arrow functions instead