Time and Rand

Added time and rand functions to Crystal. Also fixed some obscurity and
stack problems with calling library functions.