Clone functions by wrapping them

Also copy over properties because functions are objects too