Code improvements

Some code improvements.
Added Documentation and some more comments.
Merged with last commit of Krisi (stupid thing is GitHub).
And at last - the game is still playable.