Safe Factory Pattern - Private instance state in JavaScript