Restructured JS document, and some additions into it