Various bugfixes, refactoring, new player interface