refactor Monitor.callback
refactor out rlist and wlist
add modification-safe method
Merge branch 'refactor-codebase' into develop