Initial implementations from old lib. No test hate, please.