Forced Dir to be int, avoiding complex pickle database

Dir objects from boost python extension were not simply converted to
int. That forced pickle to include references to slam_ext, which might
have caused problems in the future.