Use new duktape APIs

Use the new duktape APIs for setting prototypes. This commit also includes a couple of other minor changes.

Change-Id: I407b9ec1e49fa329a38c5d274d1270613ee2a4b1
Signed-off-by: gburns <gburns@qce.qualcomm.com>
Merge "Use new duktape APIs"