Add some primops to lib
Remove backward-compatible implementations of some primops

Nixpkgs requires at least Nix 1.2 anyway, so these are now useless.