implement more core functions of type and std, fixed Math.random, improve python generation in general