Rfc6810 bis

pull request for reviewing code
remove the fast forward declarations, reorder functions instead