Implement Visitor Pattern

And implement `has_symbol` and `coeff` using it. The idea is that once Visitor Pattern is implemented in e48c5c4acc57a8e1b5a608538e3bf6795933fd9f, then the core classes don't need any other modifications and one can implement all the algorithms using it, for now I just did `has_symbol` and `coeff`, but it can be done for `expand` and other things. Essentially instead of hooking up virtual methods into our core classes, one writes a visitor, so the new code is localized and the core classes are kept simple.

Speed wise, instead of one virtual call, this is using two virtual calls. So it's a bit slower, but it should be faster than using RTTI directly (like `dynamic_cast`). So the idea is that one can quickly and easily implement many algorithms, with reasonable speed and without modifying our core classes. As long as there is substantial work that needs to be done overall, the extra virtual function call shouldn't matter. But one can always see if there is a faster implementation for the given algorithm by hooking it up into the core classes directly later.


I am still not happy, I tried to possibly simplify the code using templates in 0c884968f752be19923e2afee1ec59d46a0d7cd9, it finally compiles, but tests fail, due to bad casting in `dynamic_cast` (we need something like virtual functions, which can't be done with templates -- I left a comment https://github.com/sympy/csympy/commit/0c884968f752be19923e2afee1ec59d46a0d7cd9#commitcomment-6998971 there explaining why it fails). I haven't figured out how to make it work with templates.

Otherwise most of the things are there.

TODO:

* [x] add the `accept` method into each class (currently it is in `Function`, but we need to remove it from `Function` and add it to the lowest level classes like `Sin`, `Cos`, ..., that are actually instantiated)
* [ ] Finish the `coef` implementation