UI: Modularize scratch book and make it reusable as regular ui element, refactor charts