Refactor lgt_createinput

A big refactoring is in order. The createinput tool has grown so big and messy it needs to be split into more files and functions need namechanges, too.

This is potentially big and timeconsuming so it will be done using a WIP branch