Fix listlen, add Environment:registerLibrary, add test for listlen.