Merge wa0uwh

Merging wa0uwh work into the mainstream branch, making sure it still works for "stock" minimas and also starting to reorganize code.