Changed directory structure. Moved code to scripts and removed duplicates