JS promise re-invented and minimized