OOP (or nearly?) JS Script