Bump prime and elements to their latest versions

As the title says, bumped `prime` and `elements` packages to their latest versions and updated the code to reflect changes in the `prime` package.