Namespaced and transformed everything into functions.
Added bubble logic and better cross-referencing between objects.