Reorganizing and cleanup

Moving things in the JS doc to better comment and organize things in the
flow of how they need to happen.