restructured theme functions. updated scripts and styles.