Use new duration interface in rrdfetch

Refactored the functions so they're in the API and use them to simplify specifying the resolution in rrdfetch.

In the spirit of doing helpful things for the user instead of presenting hoops to jump through, added a flag to rrdfetch that does the alignment recommended in the RESOLUTION INTERVAL section.  I must admit, though, I've been unable to reproduce the situation described there: in all my attempts rrd_fetch always selects the 900s RRA as the best data source.  I'm not sure whether the situation described has been worked around through changes made after the documentation was written, or if I've missed something.  Nonetheless, if alignment is important, the flag does what the documentation recommends be done.