Added model.when

Added model.when for functional reactive models. See also https://github.com/curran/model .