Update asset handler to export function

This is so we can pass the sandbox object in lib/routes.js