Separated commandline script and module. Added prettytables.

Changed default output of commandline script to PrettyTables for a
nicer output. Added the ability to output data as a dict or a json
object.