Attempt to build javascript framework from scratch