Implements Scala's Option as an exercise