Huge code replacement, wifi class reimplemented