fix encoding error
add local running option, tagging and organization of outfiles and some code cleanup. Closes #7, #6, #12, #17, #19, #20