Make menu cacheable

* Make menu cacheble
* better classes for the menu nodes
* minor refactoring
Change line endings to LF

no functional change