Renamed functions and variables.
Moved code which deals with all audio outputs at once into a separate library.