Support the RTDB emulator #3491
This adds support for the emulator and also for the "ns" query param.\
Technically, iOS doesn't need the "ns" query param since "localhost" is a valid RTDB namespace name and we could just use "localhost" as the namespace. But since I just went all out on Android (firebase/firebase-android-sdk#680), I decided to make this PR equally awesome. Plus who doesn't like some good URL decoding/encoding mess.