Server scripts: Fix/improve many warnings

This is a part 1, I'll do some more later.

Also changes some behavior for the better:
* indexOfTeamPokeMove now returns -1 when the request was valid, but the pokemon doesn't have the move

Question, is it ok if some functions become more strict (like emit warnings) along with returning undefined? For example sys.playersOfChannel (or even sys.channel). Could be useful to fix some nasty bugs (more sys.--exists then, functions to prevent those warnings)