Diversity and Reliability in Erasure Networks: Rate Allocation, Coding, and Routing