handler flow cleanup.
Sort bindings by repo_id; minor remaning and docstrings.