Tests fix

Test "test_custom_key_function" now passes. Also added tox config.