Organized classes into their own files, better identifier generation

No functional changes in class reorg, but using `RandomGenerator` in `GatewayMessage` in second commit