Optimize by dealing with only Documents when necessary. Purge and unhide at the right time. Fix NSNull Firebase bug.