Some refactoring plus added GPLv2 header to source files

Refactoring to support non-player entities and better
organise the concept of the "world".