Use native String.trim if available

Closes #484