Change data structure used for ALLOWED_COMMANDS

tuple -> frozenset
Add docstring
Add some command validations and introduce command constants

- validate if player tries to open chekced position
- validate if player tries to check opened position
Add check-swap feature
Minor fix on code-style