Guard against empty list

Rotating an empty list gives badarith so add a guard clause, since the
result of rotating an empty list is well known.

BugzID: 17801
Merge pull request #43 from cloudant/guard-against-empty-list

Guard against empty list