Add encapsulation to prototypes in Javascript.