Allow setting base_url as a function.