Abstract common app code
Remove unused globals
Clarify server sent state
Merge pull request #6 from mridgway/common

Abstract common app code