fix double free; support more types in Foreign
add readme