Refactor game logic. Add abstract layers and game pseudo-engine.

Story URL: https://bugzilla.stxnext.pl/show_bug.cgi?id=3672

Refactor game logic. Add abstract layers and game pseudo-engine.