Issue #45 - retry support when tokens expire.  Also some code cleanup and simplification.