A copy of LSHIFT's gen_server2 behaviour, provided as an OTP library.