implement random() and assert() macros
minor indentation cleanup
stricter type validation for arguments to function