Remove active_support dependency with handmade time/duration handling
Some refactoring and condensing of time factor definitions.