Correct how positions were managed.

Insert/Update have different rules depending on where the new/update buildpack needs to slot into.
Added testcases to cover the more basic insert in the middle.
Overall test cleanup, removed tests that no longer made sense, fixed ones that had misleading intent.
Merge remote-tracking branch 'origin/pr/190'

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Introduce default rake task

- Runs rubocop then specs
- [Finishes #62743498]

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Reraise error if e is not unauthorized
On drain, unregister from the router and wait before shutting down

* sending USR2 signal to cloud controller will cause it to unregister from the router
* during drain, after 20 seconds, stops accepting requests.  The wait is a poor-man's
solution to increase the chance that no requests get routed to the CC during restart.
If a router doesn't receive the message, or if there is a network delay causing the
unregister to take especially long, you could still see the cloud controller receiving
requests (which would cause 502s for a user).

Signed-off-by: Kai Zhang <kaizhang@cn.ibm.com>