Pretty large commit, lots of changes, too lazy to describe them all