Added tests and restructured directory layout a bit