fix queries in social purify
router cleanup
debug updates
unified handling of extrernal account permissions
template engine fix for multi-dimensional arrays