implement input and nested loops

correctly interprets 392quine
refactored bracket matching into its own method
privatize index_of_matching_brace