Team octopus/trailer version 102

- Significant code cleanup and refactor (ongoing)
- OSX target optimisations and minor fixes
- iOS target ready for initial testing