Use C++11 unique_ptr instead of adhoc scoped_ptr
Implement file read/write callbacks with std streams.
Introduce AutoEnterIsolate and AutoEnterScope to simplify scoped code.