I wonder how correct we need/want to be with types.  You have a lot of code here to basically check types, and to hide an internal variable.  I get why you're doing it.  But maybe you should just have `this.foo` and let people manage it on the instance.  Except in cases where you need to actually do range checks, this is probably OK.