Pull out theme-related logic into a Theme class.
Merge pull request #116 from pwnall/theme

Pull out theme-related logic into a Theme class.