added defscene macro and bundling of scenes support
added some runtime hooks and auxiliary functions