Convert almost all jQuery code to Angularjs

Fun!