changed from underscore to lodash; fixed some bugs
added appendRev option