Fixed the resizing bug on some quotes; started refactoring js