Made sure that afterXXX hooks actually happened at the last possible second; added cursor-powered queries for API; added massUpdate as non-network API