Config Writer and Refraction

Implement the configuration writer and refracted the main class to
"Main.java".