This these have been my thoughts exactly as well. I think it would be best if the templates were pure unstyled html that are well classed and all elements should have unique id's as well. Each theme should just be css and presentation javascript.
In addition, I think we should completely remove the necessity of passing in system preferences to the templates from perl scripts, and switch to using a TT plugin for accessing system preferences.
Ian also has a very good point about standard naming conventions. It would be great to get all the variations on naming wrangled into one standard version.
Another thought I've had that would simplify Koha and keep it more DRY would be to implement ajax based widgets. For instance, both
circulation.pl and
moremember.pl display a list of holds in a tab, but each is a separate implementation. If we just made this code a widget ( or even just a .inc file with all the required html and javascript ) we could reuse it on any page we wanted to.
Kyle