Added option to rerun tests afterwards
Added unloading of plugin if there is no rerun option
Added comments, reformatted code