Tournament module

~~I have implemented a first version of the tournament module. Any comments on the code so far?~~
Edit: Updated the code according to suggestions.