Methods to get paste as JSON added. Small improvements and fixes.