Rename handler, call after semaphore is initiated.

Rename the handler from dumpmem, which is not what the handler does, to
alrm_hdlr, which properly reflects that it simply handles the alarm
function and posts to a semaphore.

In addition, the first call is moved to after the semaphore is
initialized, because that's how the code should have been written.
Implement minimal option parsing

The flags -h and -p were implemented.  Still to be implemented: t, m, s,
u, d and c.
Remove errant testing code

There was some testing code that caused the program to exit prematurely.
It's relevant for my local dev copy, but probably shouldn't have been
pushed to the repo.
Rename cycle to the more sensible "snapshot", rename -c to -f

Cycles never made as much sense as snapshots, so I thought it would be
better to name them that.  Of course this meant that -c didn't make
sense since -c stood for "cycles" and we already are using -s, so now
I'm using -f for "finish" for that option.  Not the best match, but
should do.  The filenames should make more sense.
Return -1 on error instead of 0.

The error handler was incorrectly programmed to return 0, this was
changed to -1.
Implement option -t

Implement a time interval specified in seconds, also clean up some of
the code ordering wrt timer trigger/start.  Also adds -t description to
the usage message.
Implement option -m

Allow time to be specified in milliseconds.  Overflow behavior is a bit
annoying, but if it exceeds LONG_MAX it will throw an error, which is
probably acceptable.  We set seconds and miliseconds separately and it
appears to work.  Similar behavior is in place for the seconds argument.
-m will overflow approximately a thousand times quicker, but the idea
that someone would be using -m for values that high seems fairly remote.
-s would do better and counting LONG_MAX numbers of seconds seems
unlikely as well.  We can always go higher later if needed...
Fixed several typos in the user-visible messages.

What is with me and typos today?  (And before, I guess, since I made the
same mistake and didn't notice it until today.  I swear I know how to
spell most days...)
Removed unnecessary math.

Truncation behavior is specified for integer division.  (Section 2.5,
K&R, 2nd ed.)  Wasn't sure until I looked it up. :\
Implement option -f

Option -f stops after a certain number of snapshots.  The snapshot count
now starts at 1 instead of 0, which means the number the user provides
for the -f option will be the same as the number of the last snapshot.
If it was kept as before, off-by-one issues would likely lead to user
confusion.  An argument of zero is acceptable, but will instruct memsnap
to continue snapshotting the process indefinitely.
Refactor error message code

Code cleanup using a small helper function which decreases the number of
lines of code required to print error messages and improves readability.
Merge branch 'master' of github.com:djcapelis/memsnap
Fix read/write loop (nudge by Joe Auricchio)

I originally wrote the read/write loop without error checking, given my
requests were all going to hit even page boundaries, this seemed safe
enough for the first testing of this tool.  Of course, I had forgotten
to go back and implement error checking on the chance read() or write()
did in fact return a partial result.  Thanks to Joe for reminding me to
go back and do this right.

(In other news, I would have done this with splice(), but it was
rejecting my attempts with EBADF and since I didn't see any bugs, I'm
assuming that this is because the kernel treats /proc files strangely
and that is splice()'s way of saying that.  If my assumption is right,
it should probably be documented in the splice(2) manpage.)
Update .gitignore to include vim swap files and snap* files.