Python: Fixed backwards compat, Cleaned up code, 

* Re-introduced type as optional argument to support legacy code
* Various python binding cleanups.
* Recovery: removed `lru_cache` - it's unused now.