Major refactor for lycheeJS 0.7
Small fixes