Refactor recording api methods and fix logic

Refactored code of recording api setup, teardown, and
endpoint functions.

Added a get_current_state_str() method to Multimedia to make some code
in recording api cleaner.

Fix to recording api logic determining next_id.
Fix to test_server.py teardown to undo patching to media_dict

closes #629
Rather than having all these separate temp folders floating around, maybe it would be better to consolidate things.

The `tmpdir` fixture will automatically give you a new temp folder, and then you can make sub-folders for config and videos (see `tmpdir.mkdir('subfolder')`). Using `str(..)` on any of these `tmpdir` things will give you the absolute path to the temporary folder. This fixture will also delete its own temp folder during teardown automatically.