Another huge test update + some bugfixes.
Reformat
Updated/added license and copyright information