duplication refactor for _bulk_docs, magic numbers, don't track lib.js,