Moved the firebase transaction functions into separate js file.