Updated to make a bit more readable.
Initial, very basic theme provider logic.