Modularize code and add README