I know you don't technically need it, because your mod barely does anything with the inventory, however the game will automatically place things in the correct slots if you change how you're inputting things into the inventory.
I started with your mod and made my own on top of it, so just take a look at my version if you want to see. I'll copy and paste the bit of code I changed that made inventory much better though;
--Add items from the 'kit' table
for i,v in pairs(kit) do
p.insert(v)
end
https://mods.factorio.com/mod/AlternativeStart