Added new helper to escape URIs called 'encode'

fixes #1089