Improved theme script loading