Added test files
Refactored files.

Error with opening file needs to be fixed.