Some minor timer refactoring to give better timing when the tick
interval is changes.  Also separated internal calls from external
implementation so interupts can be effectively mask.