refactor to add multiple protocol support back in
add countdb protocol
remove/reorganize legacy code
remove old dead code