Refactor source string query

Prepare to expose a function formatting ASTs without source string