Merge pull request #1 from spaghetticode/master

refactoring
bugfixes
complete match cycle
update game cycle