Overhaul of logging. Changed mostly .sh files