Moved most of the fingerprint code to its own lib