Restructured files. Added test scripts