Alright, I pretty much created an entirely new version, with most of the functionality ready. It supports bobs tech (logistics packs, gold science packs, alien science packs) but not the "packs" from bob modules (module case, etc) and any mod that might change the technology unlock for science packs.
I commented most of the important lines so you can see what goes on in every function. The only issues are that the bobs mod science packs look like water in pipes and tanks (but still use the right icon) and that there are 4 rows of science packs in the crafting menu that can't be hidden (3 of which can't be hand-crafted by player).
I would suggest making some kind of furnace-type machine that takes science packs and outputs liquids, and vice-versa. Then you can hide at least 2 rows of the recipes.
(uploaded through google drive so you can view the internal files before downloading, in case anyone is paranoid)
https://drive.google.com/file/d/11565m8jS6d7iaRD2cIa4A5GyYW5whqxz/view?usp=sharing