Adding clone method to FunctionCapsule

close #18