added unit tests and did major directory overhaul
added missing files from previous commit