LOTS OF PROGRESS.
It kinda works now, still some NPEs I'm trying to fix.