Fix incorrect basename/dirname
Better support for output formats

Summary table now correctly works with raw and natural formats. It also uses
the new _pad function to pad strings to the field width regardless of the
length of the string
Code cleanup
Add support for limiting time range

Command line options --time-start=[time] and --time-end=[time] are now
implemented to limit the results output by the 'downtime', 'uptime',
'all-data' and 'summary' commands. [time] must be a valid Unix time. In the
absence of an explicit setting, they default to the first recorded time and
the last recorded time for time-start and time-end respectively
Code cleanup

Reduce length of many variables by using 'local' inside functions.
Add end-time command

Similar to start-time, end-time returns the last update time
Change summary command to show last update instead of first boot time
Read file once

file_prepare reads the file into filecontents, then all functions just use
that variable instead of reading the file, reducing the overall IO load and
improving performance
Error on invalid option, add support for -- to ignore further options
Add new 'state' command, bump version to 2.8

'state' outputs a list of times relative to time-start that define how long
the system has been in each state. It supports both percentage output and raw
seconds output. Its output format is:

  <beginning state>
  <length of state 1>
  <length of state 2>
  ...
  <length of state n>

* Each state alternates from the one before it, so if the beginning state is
  'up' then the first state length is the length of time the system was up,
  followed by how long the system was down, then up etc.
* <beginning state> is a simple string defining the state at the beginning.
  Possible options are 'up' and 'down'.
* In percentage mode, the 'length' of each state is a percentage of the total
  time specified by time-start and time-end.
Fix some formatting in README.md