Generic gen_server framework.