The Alfresco model used in our FreeMarker integration is created dynamically at runtime. It is based on various 'static' objects such as the Company Home reference, but mostly basic on dynamic objects such as the current user, current user Home Space, current Document etc.
The class that provides the model is called:
org.alfresco.web.ui.repo.component.template.DefaultModelHelper
You may be able to pass in the correct noderef objects to the buildDefaultModel() method to create a valid Alfresco model. The model needs to execute within the context of a running Alfresco server due to the dynamic objects it creates when walking the model.
Thanks,
Kevin