Javascript normaliser for user input from web forms, APIs, etc.