small updates, some unittesting added
much updating of unittests, and rearranging of files