Updated callback function handling to be more in line with node packages.

The callback function will now be called using (error, result) as its
arguments, which allows for error handling within the externa application.