Statistics Using Ranks: A Unified Approach