The commissioning of the ALICE time-of-flight detector and results from the 2008 cosmic-ray data taking