flow_table: Fix formatting of docstrings
flow_table: Fix formatting of function headers

Normalized spacing of class/function/method headers
flow_table: Fix some code formatting in TableEntry
flow_table: Code format improvements in TableEntry

In these cases, minor changes were made to the code to improve
readability and/or formatting.
flow_table: Raise exceptions instead of strings

Raising of strings as exceptions has been deprecated since
Python 1.5 and we probably shouldn't be doing it.
flow_table: Fix some code formatting in FlowTable
flow_table: Refactor flow removal

This factors out common code for removing flow entries into a
helper function.  Additionally, it uses a list comprehension
instead of individual removals in hopes of being more
efficient.
flow_table: Remove unnecessary for/else

Python's for/else is a strange construction and its use wasn't really
warranted here.  Removing it is more readable at no cost.
flow_table: Fix some formatting in SwitchFlowTable

This removes extraneous parentheses around if conditions and uses an
OpenFlow "constant" itself rather than its entry in the _rev_map.
flow_table: Fix formatting in process_flow_mod()

This patch stores some instance variables of the flow_mod in local
variables to make the code more readable.
flow_table: Compare to None using is/is not
flow_table: Remove obsolete comment
flow_table: Remove counters dictionary

Various things (including but not limited to counters) were stored
in a dictionary.  They're now just kept in attributes.
flow_table: Fix computation of flow nsec

The nanosecond duration for an entry was being computed as the
*total* nanoseconds.  It's supposed to be the nanosecond delta
from the seconds field.  Fixed.  (Spec 5.3.5)
flow_table: FlowTable.flow_stats didn't use 'now'

This method took a 'now' parameter, but didn't actually use it.
Now it does.
flow_table: Minor cleanup

This cleans up/improves some comments, removes an unused method, and makes
other minor stylistic improvements.  Perhaps most notably, it adds an
"effective_priority" attribute to flow entries which is "infinitely" high
when the entry is an exact-match entry.
flow_table: Improve performance of flow removal

In some quick tests, this resulted in significant savings.
flow_table: Improve performance of flow add

We now do a binary search to find the correct place for the new flow
entry.  The table order is no longer stable, but I don't think we care.
packet: Set .next to None when parsing fails

This is related to 029b041 and 1705997.  We now try to make sure that
when parsing fails, .next is set to None.  This is already the case
for most packet classes, as they initialize .next to None.  Some
classes, however, initialize to an empty bytes object.  We now set
.next to None at the start of parsing for these classes.

It's possible that .next should always just be initialized to None,
but I couldn't convince myself this wouldn't break anything, so I'm
leaving that for another day.
packet: Revert 029b041

Related to 1705997, 029b041 and 5b342fd.

Now that failing to parse (hopefully) always results in .next being
None, we can check for None explicitly when deciding to use .raw
instead of repacking.