move function `starts_with`, which was declared twice in separate files, to the api, and make those files use that function instead.
clean up things that were broken after renaming `bg_core` to `bg_terrain`. also clean up after global rename that added `bg_` prefix to every mod name.