Refactors xray.style and xray.styleConsoleLine to have cleaner apis and
more functional style