Moved home javascript to angular controller (rough)