Add specs for copy and paste functionality
Clean up code a bit, add TomDoc comments