object oriented programming javascript library