Code changes, added theme dection, some docs