Factor ambient color out from shading

Also fixed the bug when ambient color was taking into account multiple
times when there were more than one light sources.