external resource

It is a draft version, not finished. Open a PR here to review and discuss with @yzhou2001 
```Int``` argument in ```init``` and ```term``` is for what?