Rejig limit to be an options hash.
Fixing a bug in limit/offset implementation for themes.

limit / offset also now working for documents.