Factory added

Controller and factory in different js files, fixes in views and data
retrieving from factory.