Refactored code for rebuilding endpoint into publicly available class.
Added a test to try to reconstruct an endpoint with a map in it.  Test currently fails.  Debugging now.