Add v8::TryCatch calls to handle exceptions in function callbacks