Main functionallity moved from controller to directive. Loading functionallity removed from direcive.