Add option to trim whitespaces on save
Use custom promise implementation to avoid swallowing of js error from rjected and not reported promises'