Move all scripts to files. gh-67
Improve code style.