Continued encoding packet code:
- moved things around
- added new class ValueChecker that centralizes parameter value
checking, masking and reading/writing
- added methods to utility class UnsignedTypes