Added return type and more debug

Added return_type property which lets you return the results as an array or as an object. Also added debugging to the get_count method