Refactor code to isolate legend. Now styesheet, js, layout are in saperated folders.