Added a duration() method to Rest, closing Issue #4