Big refactor; Update dependancies