refactored some, added rough identification API and CLI. needs testing to verify i did not break anything.