First uploadable version of decoupling script

A lot of changes, not expected to be functional yet