initial commit rework to object oriented JS