Add support for automatic indexes

+ Store indexes according to spec[:index]
+ Pass object to update fun instead of decoded value
Fix error where :merge_updates where not honoured
Add support for :(range|index)opts
Fix error in index expansion