Add liblights

and some other tiny changes