Update $$defaults processing to work better with FirebaseArray

@davideast Updated $$defaults processing to work better with FirebaseArray and added additional unit tests. cc @jacobawenger