Add duration conversion functions and replace duration checks accordingly

Added `.durationToFraction()` and `durationToInteger()`

Refactored `.durationToTicks`