core tera: break primitive conversion to Salt into separate modules