Use a real CSPRNG

Instead of md5(uniqid()) monstrosities, let the operating system provide the entropy.
Updated the formatting style to be more PSR-4 compliant.