try to use stuart sierra's components's style for libraries:
- encapsulate all the runtime state needed by this library in a single
data structure
- provide functions to construct that data structure
- take the encapsulated runtime state as an argument to any library
function which depends on it