Move env out of library. Make subscribe backend configurable.