Refactored all relevant files and structure, added licence