Major refactor, some basics working.