Add support for setting secret

This supports setters for the secret, counter, time_offset,
time_interval and time_drift properties. Setting these values stores the
values unencrypted internally.
Refactor out some functions to parse

This introduces the getint() and getbool() functions in parse to avoid
some code duplication.