Implemented Firebase connection and made minor function improvements