More robust API for Stock module and extracted the time utilities to the
time_utils module.