Improve performance by only processing resources once.
Remove the now mostly useless caching.
Share some code.
Don't import zero resources.
Remove accidentally committed files.
Better toString()s here and there.