Merged existing code with newest versions of angular and angular fire