Validates input. Filters input. Escapes (and formats) output.