Add some core functions and Random class