Various fixes based on feedback

 - moved require to top of screen
 - simplified doSelect function
 - updated doInsert to return the entire object
 - removed debugging logging