Fixed if statement and function bugs.

Some other things were changed a while ago, but I can't remember what
they all did. It looks like I made a few fixes to small bugs and made
keyboardCheckReleased functional (or maybe started to?). I think I also
started with some text alignment stuff, but I don't think I finished.
I'll check it out. I also added some documentation as the code can be
confusing with such vague variable names, but I didn't take the time to
try and figure out exactly what each line of code was doing.
Merge branch 'master' of https://github.com/piluke/GameMaker-HTML5-Player