failsafe trim for parsers, checking type of Promise better, require 'promise' and 'lodash' in lib.js