Complete basic tests + move structural stuff (still untested) to separate module.