While I prefer the idea of random unlocks rather then being linked with achievements, I think there should be some sort of logic to it. Best idea I can come up with is when you kill someone, you have x% chance of getting an un-lockable item from that class. For the hats, there should be an x% chance of you winning the hat or item for any class whenever you either kill, assist, or aid in capturing/defending a point. This way, while farming is still possible, you're rewarded more for playing properly