Use time constants

Makes the code more readable.

Fixes #43.