Fix Dict insert bug by using generalized balance function

Also removes now dead code and rearchitects a few things to statically
eliminate possible future bugs.
Fixed bugs where pretty-printer generated invalid Elm code
Remove comment for things that no longer exist
Merge pull request #445 from maxsnew/dict

Fix Dict Bug
Give more reasonable names to incoming and outgoing ports
make conversion functions for input ports optional
Simplify SourceSyntax.Type AST, making record extension more restrictive as discussed with @maxsnew
Make the fix from #435
Make port checks more permissive
Get rid of input handlers for now
Minor changes to checks for ports
Generate conversion code for ports
Allow the title port to work on Strings and Signals of Strings
cosmetic: simplify traversal of maybe
Make instanceof check safer, check if it's an object before using instance of
Fix checks for node.js on stdout and stderr ports
Show nicer error messages when module initialization fails due to invalid port values
Handle signals properly, fix outgoing lists, improve errors for missing fields
cosmetic: generalize `collectLambdas` to make a list of types, move prettifying code to the Pretty instance
Correct check for outgoing higher order functions

A function can appear arbitrarily nested in a data structure, but that
function cannot have more functions within it.