Use promises in the JS contents API

Switch from passing success/error callbacks to returning ES6 promises.

Opening early so we can see if Travis likes simple promise use cases.
Only type and format can be passed, and format isn't used for directories, so it's safe to remove the parameter.