Cleaned up encapsulator

• Removed potential panics
• Added testing
• Used updated Templater