Move pep3101 code to its own file