Add random directions for gliders and improve codebase.