Cleaned up functions, changed JS uglifying