LPS-47192 Link To Page field should take care of layouts VIEW permissions
LPS-47192 Avoid duplicated code - create new function "getLayoutJSON"
LPS-47192 SF - avoid even more duplicated code
LPS-47192 SF - Fix TemplateException caused by undefined variables 'parentLayoutId', 'privateLayout'
LPS-47192 Remove unneccessary arguments + sort
LPS-47192 I believe we've always been putting macros at the bottom