total overhaul. better use of latest php features.

will upload examples, readme sometime.