Cleaned up rotate
Cast NumPy numbers to standard Python objects for serialization
Fixed rotate.py