Simple object-oriented JavaScript work