LPS-35195 fixing the logic where we weren't serving css and js for embedded portlets on the whitelist
LPS-35061 Add the logic to write head/footer css and js onto the page if the runtime portlet is run on  the first time.
LPS-35061 Create a util to hold the common code
LPS-35061 Reuse the common code
LPS-35061 Move logic into convenience methods
LPS-35061 Flush the buffer
LPS-35061 Use the correct request object
LPS-35061 SF