A simple implementation of JavaScript Maybe class