Changed the way state sharing works to include the TrumpetState class which manages accesses to the frequency and the state variables... Really needs locking.