allow custom index to be passed to stubbedDocSourceResponse
check the count of the appended fields
add scrtiped fields to mock fields, add API and getFields tests, mock some other tests
ensure fields are an IndexedArray, add tests for refreshFields
consolidate the creation of the indexPattern instance
move DocSource.onUpdate to the prototype, so it can be mocked
add tests for add/remove scripted fields, minor refactor to indexPattern to access field re-indexer
make sure an error is thrown when duplicating a scripted field name
minor refactor: allow popularization count to be greater than 1 on initial set, add tests for popularizeField