Refactor angular controller and perfomance tuning

Refactor angular controller and performance tuning by making use of cache to refer to the result of heavy load functions.