reorg directories, add testing code