Lots of changes that I haven't merged yet

#548