Cleaned up code; added start/end time properties and tests.