Code documentation

Hi, First time using GitHub for this, so let me know if there is a better way to do this...

In order to keep things short here, I'll just say: These commits are all related to adding method comments and some basic parameter type checking.

Please don't hesitate to contact me, either here, on the EMM wiki, or in the forum, for more info, or my future direction/rationale for these changes.

I'd really like to bring stability and rigour to this great app!