adding barcode refactor code

Factoring barcodes out into a general bucket which can be assigned to various projects. Guarantees unique system-wide barcodes. Updated SQL code to query this new repo for next available barcode and write to it when adding AG barcodes.