Moved javascript into its own file
Added merge_objects function