Rename files, remove unused ones
Added some unit testing and refactoring