Fix a template error and change IOFrequencyUnit to struct

In Ubuntu, g++-4.6 does not recognize IOFrequencyUnit::DAYS when
IOFrequencyUnit is a enum, so I changed it to a struct with static
const int members.