Fix project.clear()

Because of the way Base.splice() works with reindexing the lists, if the layers list is run from 0 through the end, it will only process half the list (because the reindexing changes the indexes that exist in the list). Instead, we can just run through it from the end to the beginning.

Also added a test to double-check this works.