wmflib: add to_milliseconds() / to_seconds()

These functions are like stdlib's to_bytes(), except they operate on units of
time rather than storage.

Though they are by no means essential, I think they're nice for readability and
for avoiding conversion mistakes.

Also add one use-case, as an example.

Change-Id: I03314226c2e8367325ad8a09dba446c9df1fe28d