Splitting retirement funds into three buckets with distinct tax treatments can help you avoid a nasty tax bill down the line.