[WIP] Inventory refactor

Rewrite inventory.lua to be more easily read and extended

WARNING! Not currently working. Upon opening, the inventory remains stuck on the first frame and the controls are unresponsive. I assume it has to do with the issue I noted in #1405 but I need some help finding a solution

Suggestions and thoughts are welcome.