Reusable charts

Major refactoring. Broken actually.