Core/Script: BWL full rewrite, some adaption