Refactors ui and utils out of claire.js