Simplifies TREXService

## What this does
1. Adds test to serialization (TREXService)
2. Removes a lot of duplication in TREXService

@jules2689 @JakeCataford @j-mutter