Added trainer IDs and a neat little thread-safe generator for them.

Signed-off-by: Atheriel <atheriel@gmail.com>