Added a FFI implementation of apply().
Redefined the apply() for all tensor types.
Merge pull request #2 from fidlej/topic_ffi_apply

FFI implementation of apply()