Improve d4p javascript object

This fix allows to extends the d4p object using an extension point.