cal: add runtime configuration structure

This should make code more readable and maintainable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>