Add more tests and reorganize files.