Adding remaining and next variables to the main() function.
Adding _addNext callback to the addNewDoc invocation.
Adding nextFetch request and uuids function which fetch a uuid from chouchdb and calls the callback.