createUser = function(username, password, properties, callback) {
    var doc = {};
    doc._id = 'org.couchdb.user:' + username;
    doc.name = username;
    doc.type = 'user';

    _.extend(doc, properties);

    db.newUUID(100, function (err, uuid) {
        if (err) {
            return callback(err);
        }
        doc.salt = uuid;
        doc.password_sha = sha1.hex(password + doc.salt);

        authdb(function (err, authdb) {
            if (err) { return callback(err); }
            saveUser(authdb, doc, callback);
        });
    });
}
Create a new user in the user database.

@name createUser(username, password, properties, callback)
@param {String} username
@param {String} password
@param {Hash} properties
@param {Function} callback
@api private