jQuery cleanup, create named functions in place of anonymous functions