split setup_nemakiware.rb to main and lib files