Test functions rewritten, only awaiting tests themselves (lines ~240 to end)
tests compiling; rewrite now finished! :D but untested :O