added rotate functionality, some javascript modifications and fixes, some views fixes