Large refactor

Assign Unique ID’s, Create a bunch of functions to separate concerns
etc.