Refactored AppRTC code

Added helper class with interfaces and functions that are used
throughout AppRTC code.
Replaced throwing runtime exceptions with error logging.
Cleaned up code in other classes.