Folder restructuring. Added more tests. Bug fixes.