twins: Extract TwinsEnvironment
twins: Move JSON stuff under Twins namespace