Recognize wrapping in either direction on a API.next call.

In API.next, when scrolling backwards (due to opts.reverse), must recognize wrapping before first the first slide to prevent issues.