Code review identified cleanup:
Move variables out of middle of controller and to the top so they aren't lost mixed in with scope functions.
Remove unused $location in DataEditController parameter list.
Remove global scope functions. Since one of the functions just did a simple query, moved that code into controller.