Ranks fix and syncing

Added button to reset ranks to default values. Documented and cleaned
up code in respective files